package com.xuecheng.content.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xuecheng.content.model.po.CourseTeacher;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 课程-教师关系表 Mapper 接口
 * </p>
 *
 * @author 勾新杰
 * @since 2025-01-09
 */
public interface CourseTeacherMapper extends BaseMapper<CourseTeacher> {

    /**
     * 根据课程id查询教师信息
     * @param courseId 课程id
     * @return 教师信息
     */
    @Select("select * from xcplus0107_content.course_teacher where course_id = #{courseId};")
    List<CourseTeacher> list(Long courseId);

    /**
     * 根据课程id删除教师信息
     * @param courseId 课程id
     */
    @Delete("delete from xcplus0107_content.course_teacher where course_id = #{courseId};")
    void deleteByCourseId(Long courseId);
}
